Properties

$doctype

$doctype

$lc_tags

$lc_tags

$common_attrib

$common_attrib

$containers

$containers

$bool_attrib

$bool_attrib

$tagname

$tagname

$content

$content

$attrib

$attrib

$allowed

$allowed

$header

$header

$rows

$rows

$rowindex

$rowindex

$colindex

$colindex

Methods

__construct()

__construct(array  $attrib = []) : mixed

Constructor

Parameters

array $attrib

Named tag attributes

Returns

mixed —

show()

show(array  $attrib = null) : string

Build HTML output of the table data

Parameters

array $attrib

Table attributes

Returns

string —

The final table HTML code

tag()

tag(string  $tagname, array  $attrib = [], string  $content = null, array  $allowed = null) : string

Generic method to create a HTML tag

Parameters

string $tagname

Tag name

array $attrib

Tag attributes as key/value pairs

string $content

Optional Tag content (creates a container tag)

array $allowed

List with allowed attributes, omit to allow all

Returns

string —

The XHTML tag

doctype()

doctype(string  $type) : mixed

Return DOCTYPE tag of specified type

Parameters

string $type

Document type (html5, xhtml, 'xhtml-trans, xhtml-strict)

Returns

mixed —

div()

div(mixed  $attr = null, string  $cont = null) : string

Derived method for <div> containers

Parameters

mixed $attr

Hash array with tag attributes or string with class name

string $cont

Div content

Returns

string —

HTML code

p()

p(mixed  $attr = null, string  $cont = null) : string

Derived method for <p> blocks

Parameters

mixed $attr

Hash array with tag attributes or string with class name

string $cont

Paragraph content

Returns

string —

HTML code

img()

img(string|array  $attr = null) : string

Derived method to create <img />

Parameters

string|array $attr

Hash array with tag attributes or string with image source (src)

Returns

string —

HTML code

a()

a(string|array  $attr, string  $cont) : string

Derived method for link tags

Parameters

string|array $attr

Hash array with tag attributes or string with link location (href)

string $cont

Link content

Returns

string —

HTML code

span()

span(string|array  $attr, string  $cont) : string

Derived method for inline span tags

Parameters

string|array $attr

Hash array with tag attributes or string with class name

string $cont

Tag content

Returns

string —

HTML code

label()

label(string|array  $attr, string  $cont) : string

Derived method for form element labels

Parameters

string|array $attr

Hash array with tag attributes or string with 'for' attrib

string $cont

Tag content

Returns

string —

HTML code

iframe()

iframe(string|array  $attr = null, string  $cont = null) : string

Derived method to create <iframe></iframe>

Parameters

string|array $attr

Hash array with tag attributes or string with frame source (src)

string $cont

Tag content

Returns

string —

HTML code

script()

script(string|array  $attr, string  $cont = null) : string

Derived method to create <script> tags

Parameters

string|array $attr

Hash array with tag attributes or string with script source (src)

string $cont

Javascript code to be placed as tag content

Returns

string —

HTML code

br()

br(array  $attrib = []) : string

Derived method for line breaks

Parameters

array $attrib

Associative array with tag attributes

Returns

string —

HTML code

attrib_string()

attrib_string(array  $attrib = [], array  $allowed = null) : string

Create string with attributes

Parameters

array $attrib

Associative array with tag attributes

array $allowed

List of allowed attributes

Returns

string —

Valid attribute string

parse_attrib_string()

parse_attrib_string(string  $str) : array

Convert a HTML attribute string attributes to an associative array (name => value)

Parameters

string $str

Input string

Returns

array —

Key-value pairs of parsed attributes

quote()

quote(string  $str) : string

Replacing specials characters in html attribute value

Parameters

string $str

Input string

Returns

string —

The quoted string

add()

add(array  $attr, string  $cont) : mixed

Add a table cell

Parameters

array $attr

Cell attributes

string $cont

Cell content

Returns

mixed —

add_header()

add_header(string|array  $attr, string  $cont) : mixed

Add a table header cell

Parameters

string|array $attr

Cell attributes array or class name

string $cont

Cell content

Returns

mixed —

remove_column()

remove_column(string  $class) : mixed

Remove a column from a table Useful for plugins making alterations

Parameters

string $class

Class name

Returns

mixed —

add_row()

add_row(array  $attr = []) : mixed

Jump to next row

Parameters

array $attr

Row attributes

Returns

mixed —

set_header_attribs()

set_header_attribs(string|array  $attr = []) : mixed

Set header attributes

Parameters

string|array $attr

Row attributes array or class name

Returns

mixed —

set_row_attribs()

set_row_attribs(string|array  $attr = [], int  $index = null) : mixed

Set row attributes

Parameters

string|array $attr

Row attributes array or class name

int $index

Optional row index (default current row index)

Returns

mixed —

get_row_attribs()

get_row_attribs(int  $index = null) : array

Get row attributes

Parameters

int $index

Row index

Returns

array —

Row attributes

size()

size() : int

Count number of rows

Returns

int —

The number of rows

remove_body()

remove_body() : mixed

Remove table body (all rows)

Returns

mixed —

_row_tagname()

_row_tagname() : mixed

Getter for the corresponding tag name for table row elements

Returns

mixed —

_head_tagname()

_head_tagname() : mixed

Getter for the corresponding tag name for table row elements

Returns

mixed —

_col_tagname()

_col_tagname() : mixed

Getter for the corresponding tag name for table cell elements

Returns

mixed —